//
//  ProtocolView.swift
//  ReviewSwift
//
//  Created by ladystyle100 on 2017/8/25.
//  Copyright © 2017年 WangXQ. All rights reserved.
//

import UIKit

class ProtocolView: UIView {
    
    var delegate: BaseProtocol?
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        let tap = UITapGestureRecognizer.init(target: self, action: #selector(responds(_:)))
        self.addGestureRecognizer(tap)
    }
    
    @objc func responds(_ gesture: UITapGestureRecognizer) {
        // 现在会自己判断有没有delegate了, 不用我们自己去判断了
        self.delegate?.run()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
